module fulladder1(A, B, Cin, S, Cout);
	input A, B, Cin;
	output S, Cout;
	wire s1, s2, s3, s4;

	
	xor2 instance1(A,B,s1);
	xor2 instance2(s1,Cin,S);

	nand2 instance3(Cin,s1,s2);
        nand2 instance4(A,B,s3);
	nand2 instance5(s2,s3,Cout);
endmodule	
